<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Search Engine: IndexHandler Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Search Engine
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_index_handler-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">IndexHandler Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="_index_handler_8h_source.html">IndexHandler.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a27748387661142a2eb545be6f0499996"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_index_handler.html#a27748387661142a2eb545be6f0499996">IndexHandler</a> ()</td></tr>
<tr class="separator:a27748387661142a2eb545be6f0499996"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a222c2e9f12fef0e242c7870836df88e8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_index_handler.html#a222c2e9f12fef0e242c7870836df88e8">IndexHandler</a> (char type)</td></tr>
<tr class="separator:a222c2e9f12fef0e242c7870836df88e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a679d3e7915dd4de84bc3dc2840c0e0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_index_handler.html#a4a679d3e7915dd4de84bc3dc2840c0e0">addTermsFromDocument</a> (<a class="el" href="class_document.html">Document</a> d)</td></tr>
<tr class="separator:a4a679d3e7915dd4de84bc3dc2840c0e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a708294bf8d11693889abb4ad14b6f21a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_term.html">Term</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_index_handler.html#a708294bf8d11693889abb4ad14b6f21a">insert</a> (string term)</td></tr>
<tr class="separator:a708294bf8d11693889abb4ad14b6f21a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adaa31e271a00e143414e9106b22cabc0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_term.html">Term</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_index_handler.html#adaa31e271a00e143414e9106b22cabc0">search</a> (string query)</td></tr>
<tr class="separator:adaa31e271a00e143414e9106b22cabc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8e7ca402d1071b136c888a0b22e2c02"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_index_handler.html#ab8e7ca402d1071b136c888a0b22e2c02">writeIndexToFile</a> (string filePath)</td></tr>
<tr class="separator:ab8e7ca402d1071b136c888a0b22e2c02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a874bb78c623562a0c966eb042a6de281"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_index_handler.html#a874bb78c623562a0c966eb042a6de281">readIndexFromFile</a> (string filePath)</td></tr>
<tr class="separator:a874bb78c623562a0c966eb042a6de281"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2bf2f92746644864ca2f603a996a15a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_index_handler.html#aa2bf2f92746644864ca2f603a996a15a">outputRawSearch</a> (string query)</td></tr>
<tr class="separator:aa2bf2f92746644864ca2f603a996a15a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a27748387661142a2eb545be6f0499996"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">IndexHandler::IndexHandler </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If nothing is specified, use an AVL tree by default</p>
<p>Default constructor uses an AVL tree as its structure </p>

</div>
</div>
<a class="anchor" id="a222c2e9f12fef0e242c7870836df88e8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">IndexHandler::IndexHandler </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructor allowing selection of an <a class="el" href="class_a_v_l_tree.html">AVLTree</a> or HashTable </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>char representing structure type a=AVL, b=HashTable</td></tr>
  </table>
  </dd>
</dl>
<p>Constructor for <a class="el" href="class_index_handler.html">IndexHandler</a> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the type of data structure to use a=avl tree, b=hash table, default to avl tree </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a4a679d3e7915dd4de84bc3dc2840c0e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IndexHandler::addTermsFromDocument </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_document.html">Document</a>&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a708294bf8d11693889abb4ad14b6f21a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_term.html">Term</a> * IndexHandler::insert </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>term</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Check if a term exists in the tree and if not, insert it </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">term</td><td>string to add as a term </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ptr to newly created term or the old term that was found</dd></dl>
<p>Insert a term and return a pointer to the new term </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">term</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ptr to term </dd></dl>

</div>
</div>
<a class="anchor" id="aa2bf2f92746644864ca2f603a996a15a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IndexHandler::outputRawSearch </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>query</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Take a search query, parse it and output results </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">query</td><td>Output the results of an unparsed search query </td></tr>
    <tr><td class="paramname">query</td><td>unparsed search query </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a874bb78c623562a0c966eb042a6de281"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IndexHandler::readIndexFromFile </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>filePath</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function to read the tree index from a file and back into the structure</p>
<p>Read the inverted file index from a file and back into the data structure </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filePath</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adaa31e271a00e143414e9106b22cabc0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_term.html">Term</a> * IndexHandler::search </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>query</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Search for a term in the current tree </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">query</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ptr to <a class="el" href="class_term.html">Term</a> object</dd></dl>
<p>Return the term with a given index </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">query</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to the term </dd></dl>

</div>
</div>
<a class="anchor" id="ab8e7ca402d1071b136c888a0b22e2c02"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IndexHandler::writeIndexToFile </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>filePath</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function to write the tree or hash table to a file</p>
<p>Write the inverted file index to a file (uses the methods defined in the <a class="el" href="class_a_v_l_tree.html">AVLTree</a> and HashTable adapters) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filePath</td><td>file to output to </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>C:/Users/Christopher/Documents/NetBeansProjects/pbsearch/SearchEngine/<a class="el" href="_index_handler_8h_source.html">IndexHandler.h</a></li>
<li>C:/Users/Christopher/Documents/NetBeansProjects/pbsearch/SearchEngine/<a class="el" href="_index_handler_8cpp.html">IndexHandler.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Dec 3 2012 01:21:31 for Search Engine by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>
